<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> -->
    <script src="../vue.js"></script>
    <style>
        .hidden{
            display: none;
        }
    </style>
</head>
<body>
    <div id="box">
        {{myname}}
        <!--<button onclick="handleClick()">click</button>-->
        <button v-on:click="handleClick()">click</button>
        <div :class="isShow?'':'hidden'">显示或者隐藏</div>
    </div>
    <script>
        //function handleClick(){
          //  console.log("click");
          //  app.myname = "wrb"
        //}
      var obj = {
        data() {
            return {
                myname:"future",
                isShow:false
            }
        },
        methods: {
            
            handleClick(){
                console.log("click");
                this.myname = "wch"
            }
        },
      }

      var app = Vue.createApp(obj).mount("#box");
    </script>
</body>
</html>